package com.ruoyi.fts.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fts.mapper.FtsLogisticsTrackMapper;
import com.ruoyi.fts.domain.FtsLogisticsTrack;
import com.ruoyi.fts.service.IFtsLogisticsTrackService;

/**
 * 物流轨迹Service业务层处理
 *
 * @author lumberer
 * @date 2024-10-23
 */
@Service
public class FtsLogisticsTrackServiceImpl extends ServiceImpl<FtsLogisticsTrackMapper, FtsLogisticsTrack> implements IFtsLogisticsTrackService {
    @Autowired
    private FtsLogisticsTrackMapper ftsLogisticsTrackMapper;

    /**
     * 查询物流轨迹
     *
     * @param id 物流轨迹主键
     * @return 物流轨迹
     */
    @Override
    public FtsLogisticsTrack selectFtsLogisticsTrackById(Long id) {
        return ftsLogisticsTrackMapper.selectFtsLogisticsTrackById(id);
    }

    /**
     * 查询物流轨迹列表
     *
     * @param ftsLogisticsTrack 物流轨迹
     * @return 物流轨迹
     */
    @Override
    public List<FtsLogisticsTrack> selectFtsLogisticsTrackList(FtsLogisticsTrack ftsLogisticsTrack) {
        return ftsLogisticsTrackMapper.selectFtsLogisticsTrackList(ftsLogisticsTrack);
    }

    /**
     * 新增物流轨迹
     *
     * @param ftsLogisticsTrack 物流轨迹
     * @return 结果
     */
    @Override
    public int insertFtsLogisticsTrack(FtsLogisticsTrack ftsLogisticsTrack) {
                ftsLogisticsTrack.setCreateTime(DateUtils.getNowDate());
            return ftsLogisticsTrackMapper.insert(ftsLogisticsTrack);
    }

    /**
     * 修改物流轨迹
     *
     * @param ftsLogisticsTrack 物流轨迹
     * @return 结果
     */
    @Override
    public int updateFtsLogisticsTrack(FtsLogisticsTrack ftsLogisticsTrack) {
                ftsLogisticsTrack.setUpdateTime(DateUtils.getNowDate());
        return ftsLogisticsTrackMapper.updateById(ftsLogisticsTrack);
    }

    /**
     * 批量删除物流轨迹
     *
     * @param ids 需要删除的物流轨迹主键
     * @return 结果
     */
    @Override
    public int deleteFtsLogisticsTrackByIds(Long[] ids) {
        return ftsLogisticsTrackMapper.deleteFtsLogisticsTrackByIds(ids);
    }

    /**
     * 删除物流轨迹信息
     *
     * @param id 物流轨迹主键
     * @return 结果
     */
    @Override
    public int deleteFtsLogisticsTrackById(Long id) {
        return ftsLogisticsTrackMapper.deleteFtsLogisticsTrackById(id);
    }
}